package cn.idietrade.idietradegoodsorder8003.demo.mapper;

import cn.idietrade.common.pojo.SecondOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    //批量插入，生成订单
    int insertOrder(@Param("list") List<SecondOrder> list);

    //删除订单某个商品信息
    int delOrderGoodsInfo(Integer goodsId);

    //修改订单状态
    int updateOrderState(@Param("orderState") Integer orderState,@Param("orderNo") String orderNo);

    //查询订单表最大id
    int selectOrderNums();

    //生成订单
    int addOrder(SecondOrder secondOrder);

    //查询所有订单下的所有商品信息
    List<SecondOrder> querySecondOrders(@Param("userId") Integer userId);

    //验签时通过订单编号查出订单id
    int queryOrderId(@Param("orderNo")String orderNo);

    //通过订单id修改订单状态
    int updateOrState(@Param("orderId") Integer orderId,@Param("orderState") Integer orderState);
}
